/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JTextField;

/**
 *
 * @author Long
 */
public class Creater extends javax.swing.JFrame {

    /**
     * Creates new form Creater
     */
    private String ipHost;
    public Creater() {
        initComponents();
    }
    private int typeOfPlayer;
    public JTextField getNameFeild() {
        return nameFeild;
    }
    public void setIpHost(String ipHost){
        this.ipHost = ipHost; 
    }
    public String getIpHost(){
        return ipHost;
    }

    public JButton getCreateGameButton() {
        return createGameButton;
    }

    public JButton getJoinGameButton() {
        return joinGameButton;
    }
    public int getTypeOfPlayer(){
        return typeOfPlayer;
    }
    public void setTypeOfPlayer(int type){
        this.typeOfPlayer = type;
    }
    public void addCreaterListener(ActionListener ae){
        createGameButton.addActionListener(ae);
        joinGameButton.addActionListener(ae);
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        createGameButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        nameFeild = new javax.swing.JTextField();
        joinGameButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        createGameButton.setText("Create game");

        jLabel1.setText("Enter your name:");

        joinGameButton.setText("Join game");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(77, 77, 77)
                        .addComponent(createGameButton)
                        .addGap(32, 32, 32)
                        .addComponent(joinGameButton))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(53, 53, 53)
                        .addComponent(jLabel1)
                        .addGap(33, 33, 33)
                        .addComponent(nameFeild, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(nameFeild, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 104, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(createGameButton)
                    .addComponent(joinGameButton))
                .addGap(33, 33, 33))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton createGameButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton joinGameButton;
    private javax.swing.JTextField nameFeild;
    // End of variables declaration//GEN-END:variables
}
